/********************************************************************************
* Project       : No Latency RTSP streaming Project
* Author        : Seo, SeokWon
* e-mail        : kueony@gmail.com
* Licence       : See the Copyright
*********************************************************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "vll_server_setting.h"
#include "lib_log.h"
#include "lib_str.h"

#define	VLL_SERVER_INIT_FILE			"vll_server.init"

#define MC_CHECK_INIT_SERV_IP			"SERVER_IP"
#define MC_CHECK_INIT_SERV_PORT			"SERVER_PORT"

void SetInitInfo(st_VllSetInfo* a_pstSetInfo)
{
	char			caBuf[512];
	st_VllSetInfo	stSetInfo;

	bzero(&stSetInfo, sizeof(stSetInfo));

	bzero(caBuf, sizeof(caBuf));
	if(GetValueByTagInFile((char*)VLL_SERVER_INIT_FILE, (char*)MC_CHECK_INIT_SERV_IP, caBuf) == 0)
	{
		sprintf(stSetInfo.caServIp, "%.64s", caBuf); 
	}

	bzero(caBuf, sizeof(caBuf));
	if(GetValueByTagInFile((char*)VLL_SERVER_INIT_FILE, (char*)MC_CHECK_INIT_SERV_PORT, caBuf) == 0)
	{
		stSetInfo.iServPort = atoi(caBuf);
	}

	LogMsg(LIB_LOG_TYPE_DEBUG, "(%s,%d) SERVER_IP=%s", __FILE__, __LINE__, stSetInfo.caServIp);
	LogMsg(LIB_LOG_TYPE_DEBUG, "(%s,%d) SERVER_PORT=%d", __FILE__, __LINE__, stSetInfo.iServPort);

	memcpy(a_pstSetInfo, &stSetInfo, sizeof(stSetInfo));

	return;
}

